home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / vbengine.zip / DEMO4.FRM (.txt) < prev    next >
Visual Basic Form  |  1993-04-04  |  10KB  |  260 lines

  1. Form1
  2. #VBENGINE SAMPLE APPLICATION - DEMO4
  3. Form1,
  4. Label1
  5.     Customer:
  6. Combo1
  7. Label5
  8. Address:
  9. Text2
  10. Label6
  11. City:
  12. Text3
  13. Label7
  14. State:
  15. Text4
  16. Label8
  17. Text5
  18. Label9
  19. Phone:
  20. Text6
  21.     TopButton
  22. BottomButton
  23. Bottom
  24. PreviousButton
  25. Previous
  26. NextButton
  27. UpdateButton
  28. Update
  29. InsertButton
  30. Insert
  31. DeleteButton
  32. Delete
  33. QuitButton
  34. ClearButton
  35. Clear
  36. Command1_Click
  37. result
  38. OpenEngine
  39. CloseEngine
  40.     OpenTable
  41. Data1
  42. DBase
  43. TableJ
  44.     TableNamed
  45. IndexID
  46. SaveChgs
  47. CloseTable9
  48.     GetRecord
  49. Field,
  50.     FieldName
  51. SetField
  52. GetFieldTypeE
  53.     FieldType
  54. GetField
  55. FieldValue
  56. Text1v
  57. Text2
  58. Text3
  59. Text4
  60. NextRecord
  61. PreviousRecord
  62. PutField
  63. LastRecord
  64. UpdateRecordK
  65. SearchField
  66. Record
  67. SearchMode
  68. FirstRecordh
  69.     KeySearchH
  70.     SearchKey'
  71. RecordLock;
  72. RecordUnlockLock
  73. RecordUnlock
  74. RefreshTable
  75.     TableLock
  76.     LockTable
  77. FULLLOCK
  78. UnlockTable
  79. FALSE
  80. FlushBuffers]
  81. MyName
  82. GetUserName
  83. Form_Click
  84.     Form_Load?
  85. Form_UnloadZ
  86. Cancel
  87. GetIT.
  88. FillForm
  89. Command4_Click/
  90. Command3_ClickA
  91. Command9_ClickS
  92. Command2_Clicke
  93. Command5_Clickw
  94. Command6_Click
  95. Command7_Click
  96. InsertRecord
  97. Command8_Click
  98. DeleteRecordj
  99. Text53
  100. Text6
  101. Text7
  102. Text8
  103. UpdateM
  104. Text9
  105. Text10
  106. Insert
  107. Text4_Change
  108. SHARE
  109. MASTERINDEX
  110. Form_DblClick
  111. EmptyTable
  112.     MNU_Click
  113. EncryptTable
  114. DecryptTable
  115. Password
  116. Data2\
  117. CreateTable
  118. Label4_Click
  119. NFlds
  120. FldTypes
  121. FldNames:
  122. Testy
  123. NewTable
  124. NFields
  125. FieldNames
  126. FieldTypesm
  127. AddKey
  128. PRIMARY
  129.     DeleteKey2
  130. GotoRecord
  131. RecordNumber
  132. GetRecordNumber+
  133. IsFieldBlank
  134. BlankPtr
  135. PutBlank
  136.     DataTablev
  137. Customer
  138. SaveEveryChange
  139. TopButton_Click
  140. BottomButton_Click
  141. PreviousButton_Click
  142. NextButton_Click
  143. DeleteButton_Click
  144. UpdateButton_Click
  145. InsertButton_Click
  146. QuitButton_Clickl
  147. Text1_Change
  148. status
  149. ClearButton_Click
  150. Text1_LostFocus
  151. KeSearch
  152. SEARCHFIRSTI
  153. NewName
  154. Combo1_Change
  155. Combo1
  156. Combo1_LostFocus
  157.     FillCombo
  158. FillCustomerCombo
  159. Index
  160.     ListIndexR
  161. EmptyCustomerCombo
  162. items
  163.     ListCountt
  164. Create a database variable using the DataTable structure for database operations
  165. Form_Load
  166. Initialize VBENGINE so that database capabilities are enabled.
  167. Call OpenEngine() with a string representing the user's name..
  168. and using SHARE representing file sharing mode..
  169. Visual Basic
  170. Now put the data table file name (C:\CUSTOMER.DB) in the data structureA
  171. C:\CUSTOMER"
  172. We will use the tables master index:
  173. We will buffer data changese
  174. Now open the table
  175. Now read in the data from the first record and place it in our form.
  176. Form_Unload
  177. FillForm
  178. Get the record from the table 
  179. Now lets get the customers name and put it in our form.f
  180. Specify what field we are interested in.
  181. Read in the value.
  182. Place it in the form.
  183. Now do the same thing for every field in our form ....
  184. Address"
  185. State"
  186. Phone"
  187. Update
  188. Here we do the same process found in the Insert subroutine..
  189. See that routine for reference..
  190. Address"
  191. State"
  192. Phone"
  193. Here we UPDATE the current record in the table..
  194. Insert
  195. Here we are transfering information from our form to the table..
  196. We must first associate a form value with specific fields in our table..
  197. We will make such associations by first specifying the data table field of
  198. interest. Then take the data from the corresponding form field and thenn
  199. put the field into the current record.
  200. Specify the field in the data table.
  201. Place corresponding form data into the database structures FieldValue member.
  202. Now put the field structure into the current record.
  203. Now repeat the process for all form fields..
  204. Address"
  205. State"
  206. Phone"
  207. Now INSERT the current record into the table..
  208. MNU_Click
  209. TopButton_Click
  210. Move to the first record in the table.
  211. Now fill in the form
  212. BottomButton_Click
  213. Move to the last record in the table..
  214. Now fill in the form
  215. PreviousButton_Click
  216. Move to the previous record in the table.L
  217. Now fill in the form.r
  218. NextButton_Click
  219. Move to the next record in the table.b
  220. Now fill in the form.r
  221. DeleteButton_Click
  222. Delete the current record from the data table.
  223. Now fill in the form.c
  224. UpdateButton_Click
  225. InsertButton_Click
  226. QuitButton_Click
  227. Close the data table.c
  228. Shut down the VBENGINE environment.d
  229. Now quit this application.
  230. ClearButton_Click
  231. Combo1_LostFocus
  232. For error handling
  233. Temp variable for new customer names
  234. Customer name field is field we will search on
  235. We will search for the user supplied names
  236. Search for first match of customer named
  237. Submit the search criteria
  238. Start the search
  239. If search failed
  240. Store user typed name to temp variable
  241. Clear the Form
  242. Place the new name back in the formb
  243. Let user fill in the forme
  244. If search was successfullt
  245. Fill in form with customer's information
  246. FillCustomerCombo
  247. For error detectionr
  248. Go to the first record in the table
  249. We want to put customer names in our combo box
  250. Loop to fill combo box with customer names
  251. Get the record
  252. Get the customer namex
  253. Add the name to the combo box list
  254. Move to the next recorda
  255. Reposition current record pointer to first recordo
  256. EmptyCustomerCombo
  257. Here we will empty the combo box so there are no duplicates of customers
  258. Loop to remove customer names from combo box
  259. Remove the customer name
  260.